import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
import java.util.Vector;

/**
 * This class is responsible for generating the user interface
 * @author user
 *
 */

public class Ui {
	
	private static final String MESSAGE_WELCOME = "WELCOME TO MYPLANNER!";
	private static final String MESSAGE_NO_EVENT = "You have no upcoming events for today currently";
	private static final String MESSAGE_ADD_SUCCESS = "The task/event is added successfully!";
	private static final String MESSAGE_DELETE_SUCCESS = "The task/event is deleted successfully!";
	private static final String MESSAGE_OPERATION_SUCCESS = "The operation is success!";
	private static final String MESSAGE_OPERATION_FAIL ="You have entered invalid information!";
	
	private String eventList;;
	private Parser parser;
	
	static Date todayDate = new Date(); 
	static SimpleDateFormat sdf = new SimpleDateFormat("dd/MMM");
	
	static Scanner scanner = new Scanner(System.in);
	
	public Ui()
	{
		parser = new Parser();
		eventList = new String();
	}
	
	public void startUpMenu()
	{
		System.out.println(MESSAGE_WELCOME);
		findTodayEvent();
		if (eventList.length()==0)
			System.out.println(MESSAGE_NO_EVENT);
		else
			displayTableOfEvents();
		//task = obj.search(todayDate);
		//System.out.println(task.name + "	" + task.StartTime + "	" + task.priority);
	}
	
	// May be redundant.
	public void findTodayEvent() {
		eventList = parser.displayToday();
	}
	
	public void displayTableOfEvents()
	{
		System.out.print(eventList);
	}
	
	public void readInputAndParse() throws IOException, ParseException
	{
		System.out.println(parser.processInput(scanner.nextLine()));
	}
}